home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 October / CHIP Turkiye Ekim 2000.iso / prog / naps / 04 / setup.exe / Gnucleus / ChildFrm.cpp < prev    next >
C/C++ Source or Header  |  2000-06-24  |  3KB  |  120 lines

  1. /********************************************************************************
  2.  
  3.     Gnucleus - A node application for the Gnutella network
  4.     Copyright (C) 2000 John Marshall
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; either version 2 of the License.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  
  19.     For support, questions, comments, etc...
  20.     E-Mail: 
  21.         swabby@c0re.net
  22.     
  23.     Address:
  24.         21 Cadogan Way
  25.         Nashua, NH, USA 03062
  26.  
  27. ********************************************************************************/
  28.  
  29. // ChildFrm.cpp : implementation of the CChildFrame class
  30. //
  31.  
  32. #include "stdafx.h"
  33. #include "Gnucleus.h"
  34. #include "GnucleusDoc.h"
  35.  
  36. #include "ChildFrm.h"
  37.  
  38.  
  39. #ifdef _DEBUG
  40. #define new DEBUG_NEW
  41. #undef THIS_FILE
  42. static char THIS_FILE[] = __FILE__;
  43. #endif
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CChildFrame
  47.  
  48. IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
  49.  
  50. BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
  51.     //{{AFX_MSG_MAP(CChildFrame)
  52.     ON_WM_CLOSE()
  53.     //}}AFX_MSG_MAP
  54. END_MESSAGE_MAP()
  55.  
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CChildFrame construction/destruction
  58.  
  59. CChildFrame::CChildFrame()
  60. {
  61.     // TODO: add member initialization code here
  62.     
  63. }
  64.  
  65. CChildFrame::~CChildFrame()
  66. {
  67. }
  68.  
  69. BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
  70. {
  71.     // TODO: Modify the Window class or styles here by modifying
  72.     //  the CREATESTRUCT cs
  73.  
  74.     cs.style &= ~FWS_ADDTOTITLE; 
  75.  
  76.     cs.lpszName = "Connected to 0 Nodes";
  77.  
  78.     if( !CMDIChildWnd::PreCreateWindow(cs) )
  79.         return FALSE;
  80.  
  81.     return TRUE;
  82. }
  83.  
  84.  
  85.  
  86. /////////////////////////////////////////////////////////////////////////////
  87. // CChildFrame diagnostics
  88.  
  89. #ifdef _DEBUG
  90. void CChildFrame::AssertValid() const
  91. {
  92.     CMDIChildWnd::AssertValid();
  93. }
  94.  
  95. void CChildFrame::Dump(CDumpContext& dc) const
  96. {
  97.     CMDIChildWnd::Dump(dc);
  98. }
  99.  
  100. #endif //_DEBUG
  101.  
  102. /////////////////////////////////////////////////////////////////////////////
  103. // CChildFrame message handlers
  104.  
  105.  
  106.  
  107. void CChildFrame::OnClose() 
  108. {
  109.     CString Title;
  110.  
  111.     GetWindowText(Title);
  112.     if(Title.Find("Connect") == 0 || Title.Find("Transfers") == 0)
  113.     {
  114.         ShowWindow(SW_HIDE);   
  115.         return;
  116.     }
  117.     
  118.     CMDIChildWnd::OnClose();
  119. }
  120.